package controllerLayer;

import java.io.IOException;


import modelLayer.Employee;
import modelLayer.EmployeeRecords;

public class EmployeeCtr {
	private EmployeeRecords emprec;

public EmployeeCtr() {
	emprec = EmployeeRecords.getInstance();
	}

public void createEmployee(String Id, String name, String address, String phoneNumber,
		double salary, double moneyEarned){
	emprec.createEmployee(Id, name, address, phoneNumber, salary, moneyEarned);
}
public Employee getEmployee(String empID) {
	return emprec.getEmployee(empID);
}
public String findEmployee(String empID) {
	return emprec.findEmployee(empID);
	}

public void sellItem(String id,String name,double quantity, String id2, double discount){
emprec.sellItem(id, name, quantity, id2, discount);
}
/*
 * this method sorts employees by money earned
 */
public String sortEmployees(){
	return emprec.sortEmployees();
	}

public void updateEmployee(String address, String phoneNumber, double salary, String empID)
{
	emprec.updateEmployee(address, phoneNumber, salary, empID);
}

public void deleteEmployee(String empID){
	emprec.deleteEmployee(empID);
}
public void save() throws IOException{
	emprec.save();
		}
}